<template>
    <div>
        <h3>所有注册用户</h3>
        <ul>
            <li v-for="(item, index) of list" :key="index">
                {{item.username}}
            </li>
        </ul>
    </div>
</template>

<script>
export default {
    name: 'main',
    data() {
        return {
            list: [
                {
                    id: '0001',
                    username: 'wangqiling'
                },{
                    id: '0002',
                    username: 'wangxiaojie'
                }
            ]
        }
    },
    mounted() {
        this.$http.get('http://localhost/vueapi/index.php/Home/user/index').then((res)=>{
            this.list = res.data
            console.log(res.data)
        })
    }
}
</script>

<style lang="stylus" scoped>
    h3
        font-size .36rem
        margin-bottom .2rem
    ul
        li
            line-height .6rem
</style>
